package system

import "fresh-shop-gin/global"

type Role struct {
	ID          int64  `json:"id" gorm:"primaryKey;comment: 权限ID"`
	Name        string `json:"name" gorm:"comment: 权限名称"`
	Description string `json:"description" gorm:"comment: 权限描述"`
	global.GlobalModel
}

func (Role) TableName() string {
	return "sys_role"
}

// 自定义迁移逻辑
func (r *Role) Migrate() error {
	if err := global.DB.AutoMigrate(&r); err != nil {
		return err
	}
	return nil
}
